//
//  HLCallViewController.h
//  YueYue
//
//  Created by hulu001 on 2023/6/19.
//

#import "HLViewController.h"
#import "HLRTCDefine.h"
#import "HLRtcFloatingWindow.h"

NS_ASSUME_NONNULL_BEGIN

@class HLCallViewController;

@protocol HLCallViewControllerDelegate <NSObject>

- (void)callDismissWithController:(HLCallViewController *)viewController;

- (void)callShouldBecomeSmallWithController:(HLCallViewController *)viewController;

@end


@interface HLCallViewController : HLViewController
@property (nonatomic, weak) id<HLCallViewControllerDelegate> delegate;
@property (nonatomic, assign) NSInteger avaiableInitDuration;// 初始有效通话时长 （男方）
@property (nonatomic, assign) NSInteger avaiableDuration;// 有效通话时长 （男方）
@property (nonatomic, copy) NSString *joinToken;// 加入房间的token
@property (nonatomic, copy) NSString *videoPrice; // 男的价格
@property (nonatomic, copy) NSString *videoOriginalPrice; // 原始价格
@property (nonatomic, copy) NSString *roomID;      // 房间ID
@property (nonatomic, copy) HLCommonCallbackBoolBlock matchCallback;      // 匹配回调
@property (nonatomic, assign) HLCallStatus status; // 状态
@property (nonatomic, assign)  BOOL isSecretAccept; // 是否私密接听
@property (nonatomic, strong) HLRtcFloatingWindow *smallWindow; // 视频小窗
@property (nonatomic, assign) BOOL shouldBecomeSmallWindow;



/// 女创建闪聊房间
- (void)createRoom;

/// 男加入闪聊房间
- (void)joinRoom:(NSString *)roomId
        fromUser:(HLUserInfoModel *)fromUser
        duration:(NSInteger)duration
           token:(NSString *)token;

/// 呼叫某个用户
- (void)callUser:(HLUserInfoModel *)toUserInfor
        duration:(NSInteger)duration
           token:(NSString *)token;


/// 收到呼叫
- (void)calledFormCallUser:(HLUserInfoModel *)fromUserInfor;

- (void)accept:(HLUserInfoModel *)fromUserInfor;


/// 从匹配页唤起
- (void)matchUser:(HLUserInfoModel *)userInfor
         duration:(NSInteger)duration
            token:(NSString *)token;


- (void)setupLocalRender:(UIView *)view;
- (void)setupRemoteRender:(UIView *)view;
- (void)updateRemoteView;

@end


NS_ASSUME_NONNULL_END
